<?php

namespace App\Models;

/**
 * App\Models\Banner
 *
 * @property-read mixed $url
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Banner newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Banner newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Banner query()
 * @mixin \Eloquent
 */
class Banner extends Base
{
    protected $fillable = ['url', 'course_id'];

    public function getUrlAttribute($val)
    {
        return config('app.url') . $val;
    }

    public function course()
    {
        return $this->belongsTo(Course::class);
    }
}
